let select=document.querySelector('.select-all')
select.onclick=function(e){
let selectone=document.querySelectorAll('.select-one')
selectone.forEach((v)=>{
    if(v.classList.contains('active'))
    v.classList.remove('active')
})
if(e.target.classList.contains('select-one')){
    e.target.classList.add('active')
}
}
let data=localStorage.getItem('now')
let numss=localStorage.getItem('buyNum')

if(data&&num){
    let src=''
    let tip=''
    let price=''
    data=JSON.parse(data)
    Array.from(data).forEach((goods)=>{
        src=goods.src
        tip=goods.tips
        price=goods.price
    })

    document.querySelector('.img>img').src=src
    document.querySelector('.name .product-name').innerHTML=tip
    document.querySelector('.total .txt').innerHTML=(price-0)*(numss-0)
    document.querySelector('.price').innerHTML=price+'x'+numss+'元'
    document.querySelector('.total-price').innerHTML=(price-0)*(numss-0)+'元'
    document.querySelector('.total-all').innerHTML=(price-0)*(numss-0)-10+'元'
}